package com.swt.domain;

import javax.persistence.*;

@Entity
public class Staff {
    private int staffid;
    private String staffname;
    private String staffphone;
    private String staffsex;
    private String staffrole;
    private String staffsupport;
    private String staffimg;


    private Shop shopid;
    private Integer clubClubId;

    @ManyToOne (targetEntity = Shop.class)
    @JoinColumn(name = "shopid",referencedColumnName = "shopid")
    public Shop getShopid() {
        return shopid;
    }

    public void setShopid(Shop shopid) {
        this.shopid = shopid;
    }

    @Id
    @Column(name = "staffid")
    @GeneratedValue(strategy = GenerationType.AUTO)
    public int getStaffid() {
        return staffid;
    }

    public void setStaffid(int staffid) {
        this.staffid = staffid;
    }

    @Basic
    @Column(name = "staffname")
    public String getStaffname() {
        return staffname;
    }

    public void setStaffname(String staffname) {
        this.staffname = staffname;
    }

    @Basic
    @Column(name = "staffphone")
    public String getStaffphone() {
        return staffphone;
    }

    public void setStaffphone(String staffphone) {
        this.staffphone = staffphone;
    }

    @Basic
    @Column(name = "staffsex")
    public String getStaffsex() {
        return staffsex;
    }

    public void setStaffsex(String staffsex) {
        this.staffsex = staffsex;
    }

    @Basic
    @Column(name = "staffrole")
    public String getStaffrole() {
        return staffrole;
    }

    public void setStaffrole(String staffrole) {
        this.staffrole = staffrole;
    }

    @Basic
    @Column(name = "staffsupport")
    public String getStaffsupport() {
        return staffsupport;
    }

    public void setStaffsupport(String staffsupport) {
        this.staffsupport = staffsupport;
    }

    @Basic
    @Column(name = "staffimg")
    public String getStaffimg() {
        return staffimg;
    }

    public void setStaffimg(String staffimg) {
        this.staffimg = staffimg;
    }

    @Basic
    @Column(name = "clubClubId")
    public Integer getClubClubId() {
        return clubClubId;
    }

    public void setClubClubId(Integer clubClubId) {
        this.clubClubId = clubClubId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Staff staff = (Staff) o;

        if (clubClubId != null ? !clubClubId.equals(staff.clubClubId) : staff.clubClubId != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        return clubClubId != null ? clubClubId.hashCode() : 0;
    }
}
